package com.ktgj.customer.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.customer.mapper.CardRightdetailMapper;
import com.ktgj.customer.domain.CardRightdetail;
import com.ktgj.customer.service.ICardRightdetailService;

/**
 * 卡权益Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-30
 */
@Service
public class CardRightdetailServiceImpl implements ICardRightdetailService 
{
    @Autowired
    private CardRightdetailMapper cardRightdetailMapper;

    /**
     * 查询卡权益
     * 
     * @param cardRightdetailId 卡权益ID
     * @return 卡权益
     */
    @Override
    public CardRightdetail selectCardRightdetailById(Long cardRightdetailId)
    {
        return cardRightdetailMapper.selectCardRightdetailById(cardRightdetailId);
    }

    /**
     * 查询卡权益列表
     * 
     * @param cardRightdetail 卡权益
     * @return 卡权益
     */
    @Override
    public List<CardRightdetail> selectCardRightdetailList(CardRightdetail cardRightdetail)
    {
        return cardRightdetailMapper.selectCardRightdetailList(cardRightdetail);
    }

    /**
     * 新增卡权益
     * 
     * @param cardRightdetail 卡权益
     * @return 结果
     */
    @Override
    public int insertCardRightdetail(CardRightdetail cardRightdetail)
    {
        cardRightdetail.setCreateTime(DateUtils.getNowDate());
        return cardRightdetailMapper.insertCardRightdetail(cardRightdetail);
    }

    /**
     * 修改卡权益
     * 
     * @param cardRightdetail 卡权益
     * @return 结果
     */
    @Override
    public int updateCardRightdetail(CardRightdetail cardRightdetail)
    {
        cardRightdetail.setUpdateTime(DateUtils.getNowDate());
        return cardRightdetailMapper.updateCardRightdetail(cardRightdetail);
    }

    /**
     * 批量删除卡权益
     * 
     * @param cardRightdetailIds 需要删除的卡权益ID
     * @return 结果
     */
    @Override
    public int deleteCardRightdetailByIds(Long[] cardRightdetailIds)
    {
        return cardRightdetailMapper.deleteCardRightdetailByIds(cardRightdetailIds);
    }

    /**
     * 删除卡权益信息
     * 
     * @param cardRightdetailId 卡权益ID
     * @return 结果
     */
    @Override
    public int deleteCardRightdetailById(Long cardRightdetailId)
    {
        return cardRightdetailMapper.deleteCardRightdetailById(cardRightdetailId);
    }
}
